package com.pi.wms.repository;





import com.pi.framework.core.repository.IBaseRepository;
import com.pi.wms.entity.TwaDocSoDetails;
import com.pi.wms.entity.TwaDocSoHeader;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface SoDocumentRepository extends IBaseRepository<TwaDocSoHeader, Long>{

	@Query("from TwaDocSoHeader where deliveryTerms=:docGroupNo ")
	List<TwaDocSoHeader> findHeadrByDeliveryterms(@Param("docGroupNo") String docGroupNo);

    @Query("from TwaDocSoHeader where deliveryTerms=:docGroupNo and waveId is null")
    List<TwaDocSoHeader> findHeadrByDeliverytermsAndWave(@Param("docGroupNo") String docGroupNo);

    @Query("from TwaDocSoDetails where deliveryMode=:refnumber ")
    List<TwaDocSoDetails> findDetailsByDeliveryMode(@Param("refnumber") String refnumber);
}
